﻿Imports CustomTshirtFinal

Public Class PedidoEliminar
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim id = Request.Params.Get("id")

        Dim negocio = New PedidoNegocio
        Dim modelo = negocio.obtener(id)

        Me.txtIdPedido.Value = modelo.idPedido
        Me.txtIdUsuario.Text = modelo.Usuario_idUsuario
        Me.txtFecha.Text = modelo.fecha
        Me.txtEstado.Text = modelo.estado
        Me.txtTotal.Text = modelo.total
    End Sub

    Protected Sub btnGuardar_Click(sender As Object, e As EventArgs) Handles btnGuardar.Click
        Try
            Dim negocio = New PedidoNegocio
            negocio.eliminar(Me.txtIdPedido.Value)
            Response.Redirect("Pedidos.aspx", True)
        Catch ex As Exception
            Response.Write("No se pudo eliminar")
        End Try
    End Sub

    Protected Sub btnRegresar_Click(sender As Object, e As EventArgs) Handles btnRegresar.Click
        Response.Redirect("Pedidos.aspx", True)
    End Sub
End Class